const exp = require("express")
const app = exp()
app.use("/admin",(req,res,next)=>{
    let{name} = req.query
    if (name === "白白") {
        next()
    } else {
        res.redirect("/index")
    }
})
app.get("/index",(request,response)=>{
    response.send("首页")
})
app.get("/admin",(request,response)=>{
    response.send(`用户信息: ${request.query.name}`)
})
app.listen(80,()=>{
    console.log("启动成功");
})